package com.hyacinth.serialize.impl;


import com.hyacinth.serialize.Serializer;
import com.hyacinth.serialize.SerializerAlgorithm;
import com.hyacinth.utils.serialize.FSTUtils;

/**
 * FST实现序列化接口
 * @author zhangfb
 * @version 1.0.0.1
 * @since JDK 1.8
 */
public class FSTSerializer implements Serializer {

    @Override
    public SerializerAlgorithm getSerializerAlgorithm() {
        return SerializerAlgorithm.FST;
    }

    @Override
    public byte[] serialize(Object object) {
        return FSTUtils.serializer(object);
    }

    @Override
    public <T> T deserialize(Class<T> clazz, byte[] bytes) {
        return FSTUtils.deserializer(bytes, clazz);
    }
}
